<?php
/**
 * @author cattaka.net
 */

require_once 'bootstrap.inc.php';

$dbh = NULL;
if ($dbh == NULL) {
	$dbh = new PDO($databaseDsn, NULL, NULL);
	$dbh->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
} else {
	throw new Exception(MSG_DB_ALREADY_CONNECTED);
}

$memberList=array();
if ($stmt = $dbh->query("SELECT ID,NAME FROM MEMBERS")) {
	while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
		$memberList[] = array("id"=>$row["ID"], "name"=>$row["NAME"]);
	}
	$stmt->closeCursor();
} else {
	die("Execute sql failed.");
}
$dbh = NULL;

?>
